import request from '@/utils/request'
const userApi = {
    auditList: '/v2/boss/project/apply/finance/list', // 审批列表财务！！！
    // waitListAudit: '/boss/project/apply/wait/listAudit', // PM查看待审核列表
    processListAudit: '/v2/boss/project/apply/listAudit', // PM查看已审核列料
    detail: '/v2/boss/project/apply/detail',
    taxUpdate: '/boss/project/apply/taxUpdate', // 修改个税
    audit: '/v2/boss/project/apply/audit', // 状态修改
    auditSpecial: '/v2/boss/project/apply/auditSpecial', // 特批某项费用明细
    applyTax: '/v2/boss/project/apply/tax', // 个税申报审批
    getCostExport: '/boss/project/apply/export', // 费用导出 注：接口还未出
    getUrgeStatus: '/v2/boss/project/apply/urgeStatus', // 判断是否可以催办
    getSiteCrcByPtsId: '/boss/project/team/getSiteCrcByPtsId', // 是否当前site CRC

    costRecordPay: '/v2/boss/project/apply/finance/commit'
}

// ptsId 受试者id  返回一个id
export function getSiteCrcByPtsId (parameter) {
  return request({
    url: userApi.getSiteCrcByPtsId,
    method: 'get',
    params: parameter
  })
}

// id：费用id ，processId：审批节点id
export function getUrgeStatus (parameter) {
  return request({
    url: userApi.getUrgeStatus,
    method: 'get',
    params: parameter
  })
}

// 费用申请编辑
export function auditList (parameter) {
  return request({
    url: userApi.auditList,
    method: 'get',
    params: parameter
  })
}

// 费用申请编辑
export function info (parameter) {
  return request({
    url: userApi.detail,
    method: 'get',
    params: parameter
  })
}

// 修改个税
export function tax (parameter) {
  return request({
    url: userApi.taxUpdate,
    method: 'post',
    data: parameter
  })
}

// 审核
export function switchAudit (parameter) {
  return request({
    url: userApi.audit,
    method: 'post',
    data: parameter
  })
}
// 审核
export function auditSpecial (parameter) {
  return request({
    url: userApi.auditSpecial,
    method: 'post',
    data: parameter
  })
}

// 个税申报审批
export function applyTax (parameter) {
  return request({
    url: userApi.applyTax,
    method: 'post',
    data: parameter
  })
}

// PM查看待审核列表
export function waitListAudit (parameter) {
  return request({
    url: userApi.waitListAudit,
    method: 'get',
    params: parameter
  })
}

// PM查看已审核列料
export function processListAudit (parameter) {
  return request({
    url: userApi.processListAudit,
    method: 'get',
    params: parameter
  })
}
// 费用导出
export function getCostExport (parameter) {
  return request({
    url: userApi.getCostExport,
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
// 支付
export function costRecordPay (parameter) {
  return request({
    url: userApi.costRecordPay,
    method: 'post',
    params: parameter
  })
}
